package cn.luischen.service.log.impl;

import cn.luischen.service.log.LogService;
import cn.luischen.dao.LogDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.github.pagehelper.PageHelper;
import cn.luischen.model.LogDomain;
import com.github.pagehelper.PageInfo;
import cn.luischen.exception.BusinessException;
import cn.luischen.constant.ErrorConstant;

import org.powermock.reflect.Whitebox;
import org.mockito.Mock;
import static org.junit.Assert.fail;
import org.junit.runner.RunWith;
import java.util.HashMap;
import java.util.ArrayList;
import org.mockito.MockitoAnnotations;
import com.alibaba.fastjson.JSONArray;
import org.junit.After;
import org.powermock.core.classloader.annotations.PrepareForTest;
import java.util.Map;
import static org.junit.Assert.assertEquals;
import org.powermock.modules.junit4.PowerMockRunner;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PowerMockIgnore;
import java.lang.reflect.Method;
import org.junit.rules.ExpectedException;
import org.mockito.InjectMocks;
import org.junit.Test;
import static org.junit.Assert.*;
import com.unitspirit.runtime.*;
import org.mockito.Mockito;
import java.util.List;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import org.junit.Rule;
import static org.junit.Assert.assertNotNull;
import static org.mockito.ArgumentMatchers.*;
import static org.mockito.Mockito.*;
import static org.junit.Assert.assertTrue;
import com.alibaba.fastjson.parser.ParserConfig;

/**
* The class <code>LogServiceImplTest</code> contains tests for the class <code>{@link LogServiceImpl}</code>.
* Copyright (c) 2020
* 
* @generatedBy UnitSpirit at 2021-09-07 17:52:01
* @version 1.0.20210903
*/

@PowerMockIgnore({ "javax.management.*" })
@RunWith(PowerMockRunner.class)
@PrepareForTest({ cn.luischen.dao.LogDao.class, cn.luischen.model.LogDomain.class })
public class LogServiceImpl_addLog_WGTest {

	@InjectMocks
	cn.luischen.service.log.impl.LogServiceImpl unitspirit_fixture;
	@Mock
	cn.luischen.dao.LogDao mock_LogDao;

	@Rule
	public ExpectedException unitspirit_thrown = ExpectedException.none();

	/**
	* 测试方法初始化.
	* 
	* @throws Exception 
	*         if the initialization fails for some reason 
	*  
	* @generatedBy UnitSpirit at 2021-09-07 17:52:01
	*/
	@org.junit.Before
	public void setUp() throws Exception {
		try {
			GlobalUnitInit.init();
			MockitoAnnotations.initMocks(this);
			ParserConfig.getGlobalInstance().setAutoTypeSupport(true);
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}

	/**
	* @date 2021-09-07 17:52:01
	* @see cn.luischen.service.log.impl.LogServiceImpl#addLog
	* @category auto generate by UnitSpirit  
	* @author UnitSpirit   
	*/
	@Test
	public void test_addLog_0113_190013_202_1_01() throws Throwable {
		//被测函数参数定义
		String String_p_0 = "登录后台";
		String String_p_1 = null;
		String String_p_2 = "127.0.0.1";
		Integer Integer_p_3 = 1;
		//成员变量设置

		//返回值定义 
		//该函数无返回值 

		cn.luischen.model.LogDomain mock_sub_caller_LogDomain6 = PowerMockito.mock(cn.luischen.model.LogDomain.class);
		Integer Integermock5_0 = 1;
		String Stringmock4_0 = "127.0.0.1";
		String Stringmock3_0 = null;
		String Stringmock2_0 = "登录后台";
		Integer mock_result_Integer1 = 1;

		PowerMockito.whenNew(cn.luischen.model.LogDomain.class).withNoArguments()
				.thenReturn(mock_sub_caller_LogDomain6);
		PowerMockito.doNothing().when(mock_sub_caller_LogDomain6).setAuthorId(Mockito.anyInt());
		PowerMockito.doNothing().when(mock_sub_caller_LogDomain6).setIp(anyString());
		PowerMockito.doNothing().when(mock_sub_caller_LogDomain6).setData(Mockito.any());
		PowerMockito.doNothing().when(mock_sub_caller_LogDomain6).setAction(anyString());
		PowerMockito.when(mock_LogDao.addLog(Mockito.any(cn.luischen.model.LogDomain.class)))
				.thenReturn(mock_result_Integer1);

		unitspirit_fixture.addLog(String_p_0, String_p_1, String_p_2, Integer_p_3);
		assertTrue(true);
	}

	/**
	* @date 2021-09-07 17:52:01
	* @see cn.luischen.service.log.impl.LogServiceImpl#addLog
	* @category auto generate by UnitSpirit  
	* @author UnitSpirit   
	*/
	@Test
	public void test_addLog_0113_190013_202_3_01() throws Throwable {
		//被测函数参数定义
		String String_p_0 = "登录后台";
		String String_p_1 = null;
		String String_p_2 = "127.0.0.1";
		Integer Integer_p_3 = 1;
		//成员变量设置

		//返回值定义 
		//该函数无返回值 

		cn.luischen.model.LogDomain mock_sub_caller_LogDomain6 = PowerMockito.mock(cn.luischen.model.LogDomain.class);
		Integer Integermock5_0 = 1;
		String Stringmock4_0 = "127.0.0.1";
		String Stringmock3_0 = null;
		String Stringmock2_0 = "登录后台";
		Integer mock_result_Integer1 = 1;

		PowerMockito.whenNew(cn.luischen.model.LogDomain.class).withNoArguments()
				.thenReturn(mock_sub_caller_LogDomain6);
		PowerMockito.doNothing().when(mock_sub_caller_LogDomain6).setAuthorId(Mockito.anyInt());
		PowerMockito.doNothing().when(mock_sub_caller_LogDomain6).setIp(anyString());
		PowerMockito.doNothing().when(mock_sub_caller_LogDomain6).setData(Mockito.any());
		PowerMockito.doNothing().when(mock_sub_caller_LogDomain6).setAction(anyString());
		PowerMockito.when(mock_LogDao.addLog(Mockito.any(cn.luischen.model.LogDomain.class)))
				.thenReturn(mock_result_Integer1);

		unitspirit_fixture.addLog(String_p_0, String_p_1, String_p_2, Integer_p_3);
		assertTrue(true);
	}

	/**
	* @date 2021-09-07 17:52:01
	* @see cn.luischen.service.log.impl.LogServiceImpl#addLog
	* @category auto generate by UnitSpirit  
	* @author UnitSpirit   
	*/
	@Test
	public void test_addLog_0113_190019_049_1_01() throws Throwable {
		//被测函数参数定义
		String String_p_0 = "修改个人信息";
		String String_p_1 = "{\"uid\":1,\"password\":\"111111\",\"email\":\"1034683568@qq.com\",\"screenName\":\"admin12\"}";
		String String_p_2 = "127.0.0.1";
		Integer Integer_p_3 = 1;
		//成员变量设置

		//返回值定义 
		//该函数无返回值 

		cn.luischen.model.LogDomain mock_sub_caller_LogDomain6 = PowerMockito.mock(cn.luischen.model.LogDomain.class);
		Integer Integermock5_0 = 1;
		String Stringmock4_0 = "127.0.0.1";
		String Stringmock3_0 = "{\"uid\":1,\"password\":\"111111\",\"email\":\"1034683568@qq.com\",\"screenName\":\"admin12\"}";
		String Stringmock2_0 = "修改个人信息";
		Integer mock_result_Integer1 = 1;

		PowerMockito.whenNew(cn.luischen.model.LogDomain.class).withNoArguments()
				.thenReturn(mock_sub_caller_LogDomain6);
		PowerMockito.doNothing().when(mock_sub_caller_LogDomain6).setAuthorId(Mockito.anyInt());
		PowerMockito.doNothing().when(mock_sub_caller_LogDomain6).setIp(anyString());
		PowerMockito.doNothing().when(mock_sub_caller_LogDomain6).setData(anyString());
		PowerMockito.doNothing().when(mock_sub_caller_LogDomain6).setAction(anyString());
		PowerMockito.when(mock_LogDao.addLog(Mockito.any(cn.luischen.model.LogDomain.class)))
				.thenReturn(mock_result_Integer1);

		unitspirit_fixture.addLog(String_p_0, String_p_1, String_p_2, Integer_p_3);
		assertTrue(true);
	}

	/**
	* @date 2021-09-07 17:52:02
	* @see cn.luischen.service.log.impl.LogServiceImpl#addLog
	* @category auto generate by UnitSpirit  
	* @author UnitSpirit   
	*/
	@Test
	public void test_addLog_0113_190019_049_5_01() throws Throwable {
		//被测函数参数定义
		String String_p_0 = "修改个人信息";
		String String_p_1 = "{\"uid\":1,\"password\":\"111111\",\"email\":\"1034683568@qq.com\",\"screenName\":\"admin12\"}";
		String String_p_2 = "127.0.0.1";
		Integer Integer_p_3 = 1;
		//成员变量设置

		//返回值定义 
		//该函数无返回值 

		cn.luischen.model.LogDomain mock_sub_caller_LogDomain6 = PowerMockito.mock(cn.luischen.model.LogDomain.class);
		Integer Integermock5_0 = 1;
		String Stringmock4_0 = "127.0.0.1";
		String Stringmock3_0 = "{\"uid\":1,\"password\":\"111111\",\"email\":\"1034683568@qq.com\",\"screenName\":\"admin12\"}";
		String Stringmock2_0 = "修改个人信息";
		Integer mock_result_Integer1 = 1;

		PowerMockito.whenNew(cn.luischen.model.LogDomain.class).withNoArguments()
				.thenReturn(mock_sub_caller_LogDomain6);
		PowerMockito.doNothing().when(mock_sub_caller_LogDomain6).setAuthorId(Mockito.anyInt());
		PowerMockito.doNothing().when(mock_sub_caller_LogDomain6).setIp(anyString());
		PowerMockito.doNothing().when(mock_sub_caller_LogDomain6).setData(anyString());
		PowerMockito.doNothing().when(mock_sub_caller_LogDomain6).setAction(anyString());
		PowerMockito.when(mock_LogDao.addLog(Mockito.any(cn.luischen.model.LogDomain.class)))
				.thenReturn(mock_result_Integer1);

		unitspirit_fixture.addLog(String_p_0, String_p_1, String_p_2, Integer_p_3);
		assertTrue(true);
	}

	/**
	* @date 2021-09-07 17:52:02
	* @see cn.luischen.service.log.impl.LogServiceImpl#addLog
	* @category auto generate by UnitSpirit  
	* @author UnitSpirit   
	*/
	@Test
	public void test_addLog_0113_190031_954_4_01() throws Throwable {
		//被测函数参数定义
		String String_p_0 = "修改密码";
		String String_p_1 = null;
		String String_p_2 = "127.0.0.1";
		Integer Integer_p_3 = 1;
		//成员变量设置

		//返回值定义 
		//该函数无返回值 

		cn.luischen.model.LogDomain mock_sub_caller_LogDomain6 = PowerMockito.mock(cn.luischen.model.LogDomain.class);
		Integer Integermock5_0 = 1;
		String Stringmock4_0 = "127.0.0.1";
		String Stringmock3_0 = null;
		String Stringmock2_0 = "修改密码";
		Integer mock_result_Integer1 = 1;

		PowerMockito.whenNew(cn.luischen.model.LogDomain.class).withNoArguments()
				.thenReturn(mock_sub_caller_LogDomain6);
		PowerMockito.doNothing().when(mock_sub_caller_LogDomain6).setAuthorId(Mockito.anyInt());
		PowerMockito.doNothing().when(mock_sub_caller_LogDomain6).setIp(anyString());
		PowerMockito.doNothing().when(mock_sub_caller_LogDomain6).setData(Mockito.any());
		PowerMockito.doNothing().when(mock_sub_caller_LogDomain6).setAction(anyString());
		PowerMockito.when(mock_LogDao.addLog(Mockito.any(cn.luischen.model.LogDomain.class)))
				.thenReturn(mock_result_Integer1);

		unitspirit_fixture.addLog(String_p_0, String_p_1, String_p_2, Integer_p_3);
		assertTrue(true);
	}

	/**
	* @date 2021-09-07 17:52:02
	* @see cn.luischen.service.log.impl.LogServiceImpl#addLog
	* @category auto generate by UnitSpirit  
	* @author UnitSpirit   
	*/
	@Test
	public void test_addLog_20210722_100105_201_1_01() throws Throwable {
		//被测函数参数定义
		String String_p_0 = "登录后台";
		String String_p_1 = null;
		String String_p_2 = "127.0.0.1";
		Integer Integer_p_3 = 1;
		//成员变量设置

		//返回值定义 
		//该函数无返回值 

		cn.luischen.model.LogDomain mock_sub_caller_LogDomain6 = PowerMockito.mock(cn.luischen.model.LogDomain.class);
		Integer Integermock5_0 = 1;
		String Stringmock4_0 = "127.0.0.1";
		String Stringmock3_0 = null;
		String Stringmock2_0 = "登录后台";
		Integer mock_result_Integer1 = 1;

		PowerMockito.whenNew(cn.luischen.model.LogDomain.class).withNoArguments()
				.thenReturn(mock_sub_caller_LogDomain6);
		PowerMockito.doNothing().when(mock_sub_caller_LogDomain6).setAuthorId(Mockito.anyInt());
		PowerMockito.doNothing().when(mock_sub_caller_LogDomain6).setIp(anyString());
		PowerMockito.doNothing().when(mock_sub_caller_LogDomain6).setData(Mockito.any());
		PowerMockito.doNothing().when(mock_sub_caller_LogDomain6).setAction(anyString());
		PowerMockito.when(mock_LogDao.addLog(Mockito.any(cn.luischen.model.LogDomain.class)))
				.thenReturn(mock_result_Integer1);

		unitspirit_fixture.addLog(String_p_0, String_p_1, String_p_2, Integer_p_3);
		assertTrue(true);
	}

	/**
	* @date 2021-09-07 17:52:02
	* @see cn.luischen.service.log.impl.LogServiceImpl#addLog
	* @category auto generate by UnitSpirit  
	* @author UnitSpirit   
	*/
	@Test
	public void test_addLog_20210722_100110_234_1_01() throws Throwable {
		//被测函数参数定义
		String String_p_0 = "保存系统设置";
		String String_p_1 = "{\"site_record\":\"222\",\"google_site_verification\":\"111\",\"site_description\":\"erer\",\"baidu_site_verification\":\"123\",\"site_title\":\"11122\",\"allow_install\":\"\"}";
		String String_p_2 = "127.0.0.1";
		Integer Integer_p_3 = 1;
		//成员变量设置

		//返回值定义 
		//该函数无返回值 

		cn.luischen.model.LogDomain mock_sub_caller_LogDomain6 = PowerMockito.mock(cn.luischen.model.LogDomain.class);
		Integer Integermock5_0 = 1;
		String Stringmock4_0 = "127.0.0.1";
		String Stringmock3_0 = "{\"site_record\":\"222\",\"google_site_verification\":\"111\",\"site_description\":\"erer\",\"baidu_site_verification\":\"123\",\"site_title\":\"11122\",\"allow_install\":\"\"}";
		String Stringmock2_0 = "保存系统设置";
		Integer mock_result_Integer1 = 1;

		PowerMockito.whenNew(cn.luischen.model.LogDomain.class).withNoArguments()
				.thenReturn(mock_sub_caller_LogDomain6);
		PowerMockito.doNothing().when(mock_sub_caller_LogDomain6).setAuthorId(Mockito.anyInt());
		PowerMockito.doNothing().when(mock_sub_caller_LogDomain6).setIp(anyString());
		PowerMockito.doNothing().when(mock_sub_caller_LogDomain6).setData(anyString());
		PowerMockito.doNothing().when(mock_sub_caller_LogDomain6).setAction(anyString());
		PowerMockito.when(mock_LogDao.addLog(Mockito.any(cn.luischen.model.LogDomain.class)))
				.thenReturn(mock_result_Integer1);

		unitspirit_fixture.addLog(String_p_0, String_p_1, String_p_2, Integer_p_3);
		assertTrue(true);
	}
}
